<?php
namespace app\member\controller;
use think\Controller;
use app\member\Lib\Weixin;
use app\member\Lib\Erweima;
class Qr extends Controller{
    public function code(){
        
        $content = $_GET['c'];
        $content = trim($content);
        $outfile = isset($_GET['outfile'])?$_GET['outfile']:false;
        $level = isset($_GET['level'])?$_GET['level']:3;
        $size = isset($_GET['size'])?$_GET['size']:5;
        $margin = isset($_GET['margin'])?$_GET['margin']:2;
        
        if (!$content){
            die("没有出入内容信息！");
        }else{
            $url = config('baseurl')."shop=".$content;
            $url = urlencode($url);
            $weixin = new Weixin(config("corpId"), config("secret"), config("agentid"));
            $content = $weixin->OAuthUrl($url);
            Erweima::png($content,false,100,5,2,false);
            exit();
        }
    }
}